<?php
trait HelloWorld {
    public function sayHello() {
        echo 'Hello World!1';
    }
}

 
class myclass2{
    use HelloWorld{
        sayHello as sh;
    }
}
$new=new myclass2();
$new->sh();
